# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorInstanceConfig do
  @moduledoc """
  AppConnectorInstanceConfig defines the instance config of a AppConnector.

  ## Attributes

  *   `imageConfig` (*type:* `GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ImageConfig.t`, *default:* `nil`) - ImageConfig defines the GCR images to run for the remote agent's control plane.
  *   `instanceConfig` (*type:* `map()`, *default:* `nil`) - The SLM instance agent configuration.
  *   `notificationConfig` (*type:* `GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1NotificationConfig.t`, *default:* `nil`) - NotificationConfig defines the notification mechanism that the remote instance should subscribe to in order to receive notification.
  *   `sequenceNumber` (*type:* `String.t`, *default:* `nil`) - Required. A monotonically increasing number generated and maintained by the API provider. Every time a config changes in the backend, the sequenceNumber should be bumped up to reflect the change.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :imageConfig =>
            GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ImageConfig.t()
            | nil,
          :instanceConfig => map() | nil,
          :notificationConfig =>
            GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1NotificationConfig.t()
            | nil,
          :sequenceNumber => String.t() | nil
        }

  field(:imageConfig,
    as: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1ImageConfig
  )

  field(:instanceConfig, type: :map)

  field(:notificationConfig,
    as: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1NotificationConfig
  )

  field(:sequenceNumber)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorInstanceConfig do
  def decode(value, options) do
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorInstanceConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpAppconnectorsV1AppConnectorInstanceConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
